use std::ops::Add;

fn main() {
    println!("Find max ! {}", find_max());
}

fn find_max() -> i32 {
    let nums = vec![34, 50, 23, 219, 33, 188];

    let mut max = nums[0];
    for num in nums {
        if num > max {
            max = num;
        }
    }
    return max;
}

struct Complex<T> {
    real: T,
    imag: T,
}

impl<T> Add for Complex<T>
    where T: Add<Output=T>   // or, `where T: Add<T, Output=T>`
{
    type Output = Complex<T>;

    fn add(self, rhs: Self) -> Self::Output {
        Complex {
            real: self.real + rhs.real,
            imag: self.imag + rhs.imag,
        }
    }
}